import { createRouter, createWebHistory } from "vue-router";
import Layout from "@/views/layout/index.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "layout",
      component: Layout,
      children: [
        {
          path: "home",
          name: "home",
          component: () => import("@/views/home/index.vue"),
          children: [
            {
              path: "commend",
              name: "commend",
              component: () => import("@/views/home/components/commend.vue"),
            },
          ]
        },
        {
          path: "database",
          name: "database",
          component: () => import("@/views/database/index.vue"),
        },
        {
          path: "course",
          name: "course",
          component: () => import("@/views/course/index.vue"),
        },
        {
          path: "mine",
          name: "mine",
          component: () => import("@/views/mine/index.vue"),
        },
      ],
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/login/index.vue"),
      children:[
        {
          path:"demo",
          name:"demo",
          component:()=>import("@/views/login/components/demo.vue")
        },
        {
          path:"logon",
          name:"logon",
          component:()=>import("@/views/login/components/logon.vue")
        }
      ]
    },
    {
      path: "/center",
      name: "center",
      component: () => import("@/views/center/index.vue"),
    },
    {
      path: "/message",
      name: "message",
      component: () => import("@/views/message/index.vue"),
    },
    {
      path:"/page",
      name:"page",
      component:()=>import("@/views/page/index.vue")
    },
    {
      path:"/drill",
      name:"drill",
      component:()=>import("@/views/drill/index.vue")
    },
    {
      path:"/outcome",
      name:"outcome",
      component:()=>import("@/views/outcome/index.vue")
    }
  ],
});

export default router;
